﻿<navigation:Page xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
                 xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
                 x:Class="Membership.UI.PersonnelManagement.EmployeeList" 
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                 mc:Ignorable="d"
                 xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" Loaded="Page_Loaded">

    <Grid x:Name="LayoutRoot" Margin="3">

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Border Grid.Row="0" BorderBrush="#99bbe8" BorderThickness="1,1,1,0" Height="28">
            <Border.Background>
                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#dae6f4" Offset="0"/>
                    <GradientStop Color="#cfdeef" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>


            <Grid  Opacity="0.7"  VerticalAlignment="Center">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                    <TextBlock Text="姓名：" Style="{StaticResource ListToolBarTextBlockStyle}" HorizontalAlignment="Left" />
                    <TextBox Height="23" Name="textBox1" Width="120" />
                </StackPanel>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                    <StackPanel x:Name="QueryStackPanel" Orientation="Horizontal" VerticalAlignment="Center" Cursor="Hand" MouseLeftButtonUp="QueryStackPanel_MouseLeftButtonUp">
                        <Image Source="../Images/img_query.png" Stretch="None" Margin="0,0,3,0" />
                        <TextBlock Text="查询" Style="{StaticResource ListToolBarTextBlockStyle}" />
                    </StackPanel>
                    <Image Source="../Images/img_split.png" Stretch="None" Margin="3"/>

                    <StackPanel x:Name="AddStackPanel" Orientation="Horizontal" VerticalAlignment="Center" Cursor="Hand" MouseLeftButtonUp="AddStackPanel_MouseLeftButtonUp">
                        <Image Source="../Images/img_add.png"  Stretch="None" Margin="3" />
                        <TextBlock Text="添加" Style="{StaticResource ListToolBarTextBlockStyle}"  />
                    </StackPanel>

                    <Image Source="../Images/img_split.png" Stretch="None" Margin="3"/>

                    <Image Source="../Images/img_export.png"  Cursor="Hand" Stretch="None" Margin="3" />
                    <TextBlock Text="导出" Style="{StaticResource ListToolBarTextBlockStyle}" />
                 
                </StackPanel>
            </Grid>

        </Border>
        <Border Grid.Row="1" BorderBrush="#99bbe8" BorderThickness="1,1,1,1">
            <sdk:DataGrid x:Name="ContextDataGrid" BorderThickness="0" AutoGenerateColumns="False" >
                <sdk:DataGrid.Columns>
                    <sdk:DataGridTemplateColumn Header="操作" Width="100" >
                        <sdk:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <StackPanel x:Name="spDataGridPanal" Opacity="0.7"  Orientation="Horizontal" >
                                    <Image Source="../Images/img_update.png" Cursor="Hand" Stretch="None" Margin="3" MouseLeftButtonUp="OnUpdate" />
                                    <TextBlock Text="修改" Style="{StaticResource ListToolBarTextBlockStyle}" Tag="{Binding EmployeeId}" MouseLeftButtonUp="OnUpdate"    />
                                    <Image Source="../Images/img_remove.png"  Cursor="Hand" Stretch="None" Margin="3" MouseLeftButtonUp="OnDelete" />
                                    <TextBlock Text="删除" Style="{StaticResource ListToolBarTextBlockStyle}" Tag="{Binding EmployeeId}" MouseLeftButtonUp="OnDelete" />
                                </StackPanel>
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellTemplate>
                    </sdk:DataGridTemplateColumn>

                    <sdk:DataGridTextColumn Header="ID" IsReadOnly="True" Visibility="Collapsed" Binding="{Binding EmployeeId}"/>
                    <sdk:DataGridTextColumn Header="员工姓名" IsReadOnly="True" Binding="{Binding EmployeeName}" Width="100"/>
                    <sdk:DataGridTextColumn Header="员工年龄" IsReadOnly="True" Binding="{Binding EmployeeAge}" Width="100"/>
                    <sdk:DataGridTextColumn Header="出生日期" IsReadOnly="True" Binding="{Binding Birthday,Converter={StaticResource DateTimeConvert}}" Width="100"  />
                    <sdk:DataGridTextColumn Header="民族" IsReadOnly="True" Binding="{Binding Nation}" Width="100"/>
                </sdk:DataGrid.Columns>
            </sdk:DataGrid>

        </Border>
        <Border Grid.Row="2" BorderBrush="#99bbe8" BorderThickness="1,0,1,1" Height="30">
            <Border.Background>
                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#dae6f4" Offset="0"/>
                    <GradientStop Color="#ceddef" Offset="1"/>
                </LinearGradientBrush>
            </Border.Background>
            <sdk:DataPager Height="26" Name="ContextDataPager" HorizontalAlignment="Right" IsTotalItemCountFixed="True"  PageSize="2"  AutoEllipsis="True" />
        </Border>

        <Canvas VerticalAlignment="Center" HorizontalAlignment="Center" > 
            <toolkit:BusyIndicator x:Name="LodingBusyIndicator" IsBusy="False" DisplayAfter="0"
              BusyContent="数据加载中---"></toolkit:BusyIndicator></Canvas>
           


    </Grid>

</navigation:Page>
